
*********************************************************************
*	On What Moves (Spending) Mood?                                  *
*   The Nature and Origins of Parallel Public Preferences           *
*                                                                   *
* 	Steven M. Van Hauwaert, ESPOL-LAB & Radboud University          *
*	Christopher Wlezien, University of Texas at Austin              *
* 	Ryan E. Carlin, Georgia State University                        *
*********************************************************************

use "/[pathway]/what moves mood panelled 20250507.dta"


****************************************************
// GENERATING VARIABLES //
****************************************************


gen defl_dec = deflator2012/100
label variable defl_dec "2012 deflator (decimal)"

gen real_APP_domain = APP_domain / defl_dec
gen real_APP_total = APP_total / defl_dec

gen treal_APP_domain = real_APP_domain / 1000000
gen treal_APP_total = real_APP_total / 1000000

gen treal_APP_net = treal_APP_total - treal_APP_domain // Net spending

gen treal_APP_total_excledu = treal_APP_total - treal_APP_edu

label variable gdp "Real GDP, chained 2012 USD (billions)"

gen gdp_trill = gdp/1000
label variable gdp_trill "Real GDP, chained 2012 USD (trillions)"

clear


use "/[pathway]/what moves mood non-panelled 20250513.dta"


****************************************************
// GENERATING VARIABLES //
****************************************************


gen pref_soc_int = (pref_env_int + pref_edu_int + pref_heal_int + pref_welf_int)/4
label variable pref_soc_int "Averaged social preferences, interpolated data"

factor pref_env_int pref_edu_int pref_heal_int pref_welf_int
predict mood_int
label variable mood_int "Social preferences, interpolated mood (CFA estimation)"

gen pref_soc_raw = (pref_env_raw + pref_edu_raw + pref_heal_raw + pref_welf_raw)/4
label variable pref_soc_raw "Averaged social preferences, raw data"

factor pref_env_raw pref_edu_raw pref_heal_raw pref_welf_raw
predict mood_raw
label variable mood_raw "Social preferences, raw mood (CFA estimation)"

gen treal_APP_env_net = treal_APP_total - treal_APP_env
gen treal_APP_edu_net = treal_APP_total - treal_APP_edu
gen treal_APP_health_net = treal_APP_total - treal_APP_health
gen treal_APP_welfare_net = treal_APP_total - treal_APP_welfare

